<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@page import="org.jeecgframework.web.util.StaticValue" %>
<%@include file="/context/mytags.jsp" %>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<div class="easyui-layout" fit="true">
    <div region="center" style="padding:1px;">
        <t:datagrid name="cbsDeliverErrorLogList" fitColumns="false" title="发货单异常记录表"
                    actionUrl="cbsDeliverErrorLogController.do?datagrid" idField="id" fit="true" queryMode="group">
            <t:dgCol title="主键" field="id" hidden="true" queryMode="single" width="120"></t:dgCol>
            <t:dgCol title="创建时间" field="createDate" query="true" formatter="yyyy-MM-dd" queryMode="group"
                     width="120"></t:dgCol>
            <t:dgCol title="发货单id" field="codeid" hidden="true" width="120"></t:dgCol>
            <t:dgCol title="单号" field="code" queryMode="single" width="120" query="true"
                     url="cbsDelinerController.do?goDeliverDetails&id={codeid}" funname="cbsDeliverError"></t:dgCol>
            <t:dgCol title="状态" field="isClose" query="true" queryMode="single" width="120" dictionary="<%=StaticValue.service_ERROR_Log_Type %>"></t:dgCol>
            <t:dgCol title="异常原因" field="description" queryMode="single" width="120"></t:dgCol>
            <t:dgCol title="处理办法" field="handleDescription" queryMode="single" width="120"></t:dgCol>
            <t:dgCol title="处理人" field="handleUser" queryMode="single" width="120"></t:dgCol>
            <t:dgCol title="处理时间" field="handleDate" queryMode="single" width="120"></t:dgCol>
            <t:dgCol title="处理结果" field="handleResult" queryMode="single" width="120"></t:dgCol>
            <t:dgCol title="创建人名称" field="createName" hidden="true" queryMode="single" width="120"></t:dgCol>
            <t:dgCol title="创建人登录名称" field="createBy" hidden="true" queryMode="single" width="120"></t:dgCol>
            <t:dgCol title="更新人名称" field="updateName" hidden="true" queryMode="single" width="120"></t:dgCol>
            <t:dgCol title="更新人登录名称" field="updateBy" hidden="true" queryMode="single" width="120"></t:dgCol>
            <t:dgCol title="更新日期" field="updateDate" formatter="yyyy-MM-dd" hidden="true" queryMode="single"
                     width="120"></t:dgCol>
            <t:dgCol title="是否需要系统修改" dictionary="<%=StaticValue.need_system_revise %>" field="needSystemRevise" queryMode="single" width="120" query="true"></t:dgCol>
            <t:dgCol title="管理员处理方法" field="adminDescription" queryMode="single" width="120"></t:dgCol>
            <t:dgCol title="管理员处理人" field="adminUpdateBy" queryMode="single" width="120"></t:dgCol>
            <t:dgCol title="管理员处理时间" field="adminUpdateDate" queryMode="single" width="120"></t:dgCol>
            <t:dgCol title="管理员处理结果" field="adminAbnormalResult" queryMode="single" width="120"></t:dgCol>
            <t:dgCol title="操作" field="opt" width="100"></t:dgCol>
            <t:dgFunOpt title="处理" funname="handleError(id,isClose)"/>
            <t:dgToolBar title="导出" icon="icon-putout" funname="ExportXls"></t:dgToolBar>
        </t:datagrid>
    </div>
</div>
</div>
<script src="webpage/com/zybk/org.jeecgframework/cbsDeliverErrorLogList.js"></script>
<script type="text/javascript">
    $(document).ready(function () {
        //给时间控件加上样式
        $("#cbsDeliverErrorLogListtb").find("input[name='createDate_begin']").attr("class", "Wdate").attr("style", "height:20px;width:90px;").click(function () {
            WdatePicker({dateFmt: 'yyyy-MM-dd'});
        });
        $("#cbsDeliverErrorLogListtb").find("input[name='createDate_end']").attr("class", "Wdate").attr("style", "height:20px;width:90px;").click(function () {
            WdatePicker({dateFmt: 'yyyy-MM-dd'});
        });
        $("#cbsDeliverErrorLogListtb").find("input[name='updateDate']").attr("class", "Wdate").attr("style", "height:20px;width:90px;").click(function () {
            WdatePicker({dateFmt: 'yyyy-MM-dd'});
        });
        $("#cbsDeliverErrorLogListtb").find("input[name='handleDate']").attr("class", "Wdate").attr("style", "height:20px;width:90px;").click(function () {
            WdatePicker({dateFmt: 'yyyy-MM-dd'});
        });
    });

    function handleError(id, isClose) {
        if (isClose == '已处理') {
            tip('该异常已处理');
        } else {
            $.dialog({
                content: "url:cbsDeliverErrorLogController.do?goUpdate&id=" + id,
                lock: true,
                title: "发货异常处理",
                zIndex: 2100,
                width: 600,
                height: 300,
                parent: windowapi,
                cache: false,
                ok: function () {
                    iframe = this.iframe.contentWindow;
                    iframe.$('#formobj').submit();
                    return false;
                },
                cancelVal: '关闭',
                cancel: function () {
                }
            });
        }
    }


    //导出
    function ExportXls() {
        JeecgExcelExport("cbsDeliverErrorLogController.do?exportXls","cbsDeliverErrorLogList");

    }

    function cbsDeliverError(filedName, url) {
        addOneTab("发货单详情", url);
    }
</script>